package fi.profecons.csswindows.toolkit;

import fi.profecons.csswindows.Container;

public class Form extends Container {

	private String action;
	private String enctype;
	private String method;
	
	public Form(String action, String enctype, String method){
		super();
		this.action = action;
		this.enctype = enctype;
		this.method = method;
		addCommand("new Form('" + getId() + "','" + action + "', '" + enctype + "', '" + method + "');");
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
		addCommand("getElement('"+ getId() + "').setAction('" + action + "');");
	}

	public String getEnctype() {
		return enctype;
	}

	public void setEnctype(String enctype) {
		this.enctype = enctype;
		addCommand("getElement('"+ getId() + "').setEncType('" + enctype + "');");
	}

	public String getMethod() {
		return method;
	}

	public void setMethod(String method) {
		this.method = method;
		addCommand("getElement('"+ getId() + "').setMethod('" + method + "');");
	}
	
	public void submit(){
		addCommand("getElement('" + getId() + "').submit();");
	}
	
}


